import { createBrowserRouter } from "react-router-dom";
import Login from "../pages/login/Login";
import Home from "../pages/home/Home";
import App from "../App";
import Layout from "../pages/Layout/Layout";
import List from "../pages/account/list/List";
import Add from "../pages/account/add/Add";
import Edit from "../pages/account/edit/Edit";
import Center from "../pages/account/center/Center";
import Type from "../pages/goods/type/Type";
import GAdd from "../pages/goods/add/Add";
import GList from "../pages/goods/list/List";
import Order from "../pages/order/Order";
import Shop from "../pages/shop/Shop";
import Sgoods from "../pages/statistics/goods";
import Sorder from "../pages/statistics/order";
const routes = createBrowserRouter([
    {
        path: '/',
        element: <App />,
        children: [
            {
                index: true,
                element: <Login />
            },
            {
                path: 'home',
                element: <Layout />,
                children: [
                    {
                        index: true,
                        element: <Home />
                    }
                ]
            },
            // 账户
            {
                path: 'account',
                element: <Layout />,
                children: [
                    {
                        path: 'list',
                        element: <List />
                    },
                    {
                        path: 'add',
                        element: <Add />
                    },
                    {
                        path: 'edit',
                        element: <Edit />
                    },
                    {
                        path: 'center',
                        element: <Center />
                    }
                ]
            },
            // 商品
            {
                path: 'goods',
                element: <Layout />,
                children: [
                    {
                        path: 'list',
                        element: <GList />
                    },
                    {
                        path: 'add',
                        element: <GAdd />
                    },
                    {
                        path: 'type',
                        element: <Type />
                    }
                ]
            },
            // 订单
            {
                path: 'order',
                element: <Layout />,
                children: [
                    {
                        path: 'manage',
                        element: <Order />
                    }
                ]
            },
            //店铺
            {
                path: 'store',
                element: <Layout />,
                children: [
                    {
                        path: 'manage',
                        element: <Shop />
                    }
                ]
            },
              //统计
              {
                path: 'statistics',
                element: <Layout />,
                children: [
                    {
                        path: 'product',
                        element: < Sgoods />
                    },{
                        path: 'order',
                        element: < Sorder/>
                    }
                ]
            },
            {
                path: '/permission',
                element: <permission/>
            }
        ]
    }
]);

export default routes;